package org.mao.coque.controller;

import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("game")
public class GameController {

    private final static Logger LOGGER = Logger.getLogger(GameController.class);

    @RequestMapping(value = "join")
    @ResponseBody
    public JSONObject check(HttpServletRequest request, HttpServletResponse response) {

        JSONObject json = new JSONObject();
        try {
            HttpSession httpSession = request.getSession();
            LOGGER.info("game/join: "+httpSession);
        } catch (Exception e) {
            LOGGER.error("", e);
        }
        return json;
    }
}
